/**
**************************************************************************************
*Founder Effect                                                                      *
*Copyright (C) 2006-2007, 5d Studios (www.5d-Studios.com)                            *
*                                                                                    *
*This library is free software; you can redistribute it and/or                       *
*modify it under the terms of the GNU Lesser General Public                          *
*License as published by the Free Software Foundation; either                        *
*version 2.1 of the License, or (at your option) any later version.                  *
*                                                                                    *
*This library is distributed in the hope that it will be useful,                     *
*but WITHOUT ANY WARRANTY; without even the implied warranty of                      *
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                   *
*Lesser General Public License for more details.                                     *
*                                                                                    *
*You should have received a copy of the GNU Lesser General Public                    *
*License along with this library; if not, write to the Free Software                 *
*Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA      *
**************************************************************************************
*/
#pragma once
#include <string>

/**
    Joystick buttons

    NOTE: Right now we only support the Xbox360 controller
 */
enum JoystickButtons_t
{
    J_A,
    J_B,
    J_X,
    J_Y,

    J_LEFT_TRIGGER,
    J_RIGHT_TRIGGER,

    J_BACK,
    J_START,

    J_LEFT_JOYSTICK,
    J_RIGHT_JOYSTICK
};

/**
========================
Converts key codes to a string and also converts strings to key codes
========================
*/
class KeyConverter
{
public:
    KeyConverter(void);
    
    /** Converts the given key to a string (Ex. SDLK_BACKSPACE would equal "backspace")
    // NOTE: look into SDL_GetKeyName() to help you out here.
    */
    std::string ToString( int key );

    /** Converts the given string into a valid key code (Ex. "backspace" would equal 8) */
    int ToKeyCode( std::string &key );

    /** Convert the given string into a valid Joystick Button */
    int JoystickToKeyCode( std::string &key );

    /** Convert the given key code to a string */
    std::string JoystickToString( int key );

    /** Returns the shift value of the key (Ex. SDLK_A would return 'A') */
    static char GetShiftValue( int key );

public:
    virtual ~KeyConverter(void);
};
